﻿using Confluent.Kafka;
using System;
using System.Collections.Concurrent;
using System.Collections.Generic;
using System.Runtime.Serialization;
using System.Text;
using System.Text.Unicode;

namespace Zhaoxi.KafkaServer
{
	    
	class CustomStringSerializer<T> : ISerializer<T>
	{
		public byte[] Serialize(T data, SerializationContext context)
		{
			Console.WriteLine("序列化");
			var temp = Newtonsoft.Json.JsonConvert.SerializeObject($"{context.Topic}:{data.ToString()}");
			return Encoding.UTF8.GetBytes(temp);
		}
	}
}
